package com.example.sprinbootdemo.service.impl;

import com.example.sprinbootdemo.entity.SalesMan;
import com.example.sprinbootdemo.mapper.SalesManMapper;
import com.example.sprinbootdemo.service.SalesManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SalesManServiceImpl implements SalesManService {

    @Autowired
    private SalesManMapper salesManMapper;

    @Override
    public List<SalesMan> getAllSalesMen() {
        return salesManMapper.selectAll();
    }

    @Override
    public void addSalesMan(SalesMan salesMan) {
        salesManMapper.addSalesMan(salesMan);
    }

    @Override
    public void deleteSalesManBySalesManId(int salesManId) {
        salesManMapper.deleteSalesManBySalesManId(salesManId);
    }

    @Override
    public void updateSalesManBySalesManId(SalesMan salesMan) {
        salesManMapper.updateSalesManBySalesManId(salesMan);
    }

    @Override
    public List<SalesMan> getSalesMenByName(String name) {
        return salesManMapper.getSalesMenByName(name);
    }
}